package entities;

import java.io.Serializable;

/**
 * @author Vodi
 * Message is the object that can be transfered from the client to server and vice versa
 * each message contains its type, the transfered object's type and the object itself.   
 */
public class Message implements Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private MsgType msgType;
	private ObjectType obj_type;
	private Object object;
	
	public Message(MsgType msg_type, ObjectType obj_type, Object obj) {
		setMessageType(msg_type);
		setObjectType(obj_type);
		this.object = obj;
	}

	public void setMessageType(MsgType type) {
		this.msgType = type;
	}
	
	public void setObjectType(ObjectType obj_type) {
		this.obj_type = obj_type;
	}
	
	public Object getObject() {
		return object;
	}

	public ObjectType getObjType() {
		return obj_type;
	}
	
	public MsgType getMsgType() {
		return msgType;
	}
}
